let box = document.getElementsByClassName('box')[0]
let a = box.children[0]
let img = a.firstElementChild

function updateSrc() {
  console.log(img)
  // img.src= './img/lq1.jpg'
  // 设置属性src
  img.setAttribute('src', './img/lq1.jpg')
  img.setAttribute('alt', 'img')
}

function removeClass() {
  // 删除属性class
  img.removeAttribute('class')
  img.removeAttribute('alt')
  console.log(img)
}

function getSrc() {
  let src = img.getAttribute('src')
  console.log(src)
  if (src === './img/img1.jpg') {
    img.setAttribute('src', './img/img2.png')
  }
}

function handleChange(that) {
  console.log(that.value)
  if (that.value === '1') {
    img.setAttribute('src', './img/img1.jpg')
  } else {
    img.setAttribute('src', './img/img2.png')
  }
}
